package FlowGraph.EdgeInfo;

import java.util.*;
import java.io.*;

//////////////////////////////////////////////////////////////////////////
//// ExceptionEdge
/**

@author Ivan Jeukens
@version v 0.1 18/07/2002
*/
public class ExceptionEdge extends EdgeInfo {

    public ExceptionEdge() {
        super(EdgeInfo.EXCEPTION);
        _data = new LinkedList();
    }

    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public void addData(ExceptionEdgeData data) {
        _data.add(data);
    }

    public int dataSize() {
        return _data.size();
    }

    public ExceptionEdgeData getData(int v) {
        return (ExceptionEdgeData) _data.get(v);
    }

    public ExceptionEdgeData findData(int type, int bbStatement) {
        
        return null;
    }

    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append("Exception Edge. Data:\n");
        for(int i = 0;i < _data.size();i++) {
            ExceptionEdgeData data = (ExceptionEdgeData) _data.get(i);
            buf.append("\t" + data.toString());
        }
        return buf.toString();
    }

     public void debug(DataOutputStream dout) {
        try {
            dout.writeUTF(toString());
        }
        catch(IOException ex) { 
        
        }
    }

    ///////////////////////////////////////////////////////////////////
    ////                      private variables                    ////

    private LinkedList _data;
}
